/** @jsxImportSource @emotion/react */
import * as React from "react";
import {BlobInputList, Input, InputLine, LineColumn, Select, Text,} from "customize-easy-ui-component";
import {InspectRecordLayout, InternalItemProps, useItemInputControl,} from "../../common/base";
import {useMeasureInpFilter} from "../../common/hooks";


const 结论说明选=[
    '1、锅炉运行正常，锅筒工作压力4.8MPa；\n' +
    '2、取样冷却器冷却效果不佳，应维修或更换取样冷却器；\n' +
    '3、水温过高，给水和凝结水溶解氧无现场检测条件；\n' +
    '4、饱和蒸汽钠离子超标，炉水磷酸根含量偏低，应及时查找原因，并采取有效措施。',
];

export const itemA下结论=['检验结论','检验日期','新下检日','结论说明', ];
export const ConclusionPowerSt=
    React.forwardRef((
        { children, show ,alone=true,redId,nestMd,label,}:InternalItemProps,  ref
    ) => {
        const [getInpFilter]=useMeasureInpFilter(null,itemA下结论,);
        const {inp, setInp} = useItemInputControl({ ref });
        return <InspectRecordLayout inp={inp} setInp={setInp} getInpFilter={getInpFilter} show={show} redId={redId}
                                    nestMd={nestMd} alone={alone} label={label!}>
            <Text variant="h5">{label}：</Text>
            <Text variant="h5">检验情况：</Text>
            <BlobInputList value={inp?.结论说明 ?? ''} rows={7} datalist={结论说明选}
                           onListChange={v => setInp({...inp, 结论说明: v || undefined}) } />
            <Text variant="h5">下结论&gt;&gt;</Text>
            <LineColumn>
                <InputLine  label='电站锅炉水汽质量检验结论' >
                    <Select value={ inp?.检验结论  ||''} inputSize="md" css={{minWidth:'140px',fontSize:'1.3rem',padding:'0 1rem'}}
                                    onChange={e => setInp({ ...inp, 检验结论: e.currentTarget.value||undefined}) }>
                        <option></option>
                        <option>符合要求</option>
                        <option>基本符合要求</option>
                        <option>不符合要求</option>
                    </Select>
                </InputLine>
                <InputLine label='设置检验日期'>
                    <Input value={inp?.检验日期 || ''} type='date'
                           onChange={e => setInp({...inp, 检验日期: e.currentTarget.value})}/>
                </InputLine>
                <InputLine  label='下次检验日期' >
                    <Input  value={inp?.新下检日 ||''}  type='date'
                            onChange={e => setInp({ ...inp, 新下检日: e.currentTarget.value}) } />
                </InputLine>
            </LineColumn>
        </InspectRecordLayout>;
});
